package com.witframework.util;

import org.apache.tools.ant.Task;

public class CheckSumCondition extends Task {

  protected String obDir;
  protected String type;
  protected String property;

  public void execute() {
    CheckSum cs = new CheckSum(obDir);
    // project.setProperty(property,
    // !cs.getCheckSum(type).equals(cs.calculateCheckSum(type).toString());//

    getProject().setProperty(property,
        (!cs.getCheckSum(type).equals(cs.calculateCheckSum(type))) ? "true" : "false");
    // return !cs.getCheckSum(type).equals(cs.calculateCheckSum(type));
  }

  public String getObDir() {
    return obDir;
  }

  public void setObDir(String obDir) {
    this.obDir = obDir;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public String getProperty() {
    return property;
  }

  public void setProperty(String property) {
    this.property = property;
  }

}
